package com.commit.mapper;

import com.commit.domain.Answer;
import com.commit.domain.Question;
import com.commit.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author:zyh
 * @Time:2021-02-27-18:22
 * @email:1269231889@qq.com
 */
@Mapper
public interface UserMapper {
    //注册
    void insert(User user);

    //登录
    User findByLoginName(String loginName);

    //通过id查找
    User findById(Integer id);

    //展示用户提出的所有问题
    List<Question> allQuestion(@Param("username")String name);

    //展示用户的所有回答
    List<Answer> allAnswer(@Param("username")String name);

    //采纳回答
    void accept(Integer id,Integer answerId);

    //关闭问题
    void closed(Integer questionId);
}
